<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>用户信息</title>
<%@include file="/head.jsp"%>
<script src="${basePath}/jsp/system/User/index.js" type="text/javascript"></script>
</head>
<body class="easyui-layout">
	<div id="center" region="west" split="true" style="width:550px;" title="用户信息" >
		<div class="tool-bar">
			<a class="easyui-linkbutton" iconCls="icon-add" plain="true" href="javascript:void(0);" onclick="btn_add();">添加</a>
			<a class="easyui-linkbutton" iconCls="icon-edit" plain="true" href="javascript:void(0);" onclick="btn_edit();">编辑</a>
			<a class="easyui-linkbutton" iconCls="icon-delete" plain="true" href="javascript:void(0);" onclick="btn_delete();">删除</a>
		</div>
		<div class="context">
			<table id="grid" tmpl="#template" pager="#pager" url="system/User/getRoleData" style="width: 500px;">
				<thead class="datagrid-header">
					<tr>
						<th style="width: 30px;"><input type="checkbox" onclick="$('.easyui-simplegrid').simplegrid('selectAll', this.checked);" /></th>
						<th>用户帐号</th>
						<th>用户名称</th>
						<th>性别</th>
						<th>最后登陆时间</th>
						<th>用户状态</th>
					</tr>
				</thead>
				<tbody>
				</tbody>
			</table>
			<script id="template" type="text/x-jquery-tmpl">
			<tr>
				<td name="id" value="{{= id}}"><input type="checkbox"/></td>
				<td name="username">{{= username}}</td>
				<td name="name">{{= name}}</td>
				<td name="sex">{{= coding.sex[sex]}}</td>
				<td name="lastlogin">{{= lastlogin}}</td>
				<td name="state">{{= coding.state[state]}}</td>
			</tr>
		</script>
	<!-- 		.format("yyyy-MM-dd hh:mm:ss.S") -->
		</div>
		<!-- 分页 -->
		<div id="pager" class="pager"></div>
	</div>

	<div region="center" split="true" style="width:200px;" title="权限信息">
		<div id="user_role" class="easyui-layout" fit="true">
			<div region="west" split="true" style="width:150px;" title="角色信息">
				<div id="role-div" style="height:550px; border: #ccc solid 1px; overflow: auto;">
					<ul id="role-ul" class="easyui-tree" url="system/Role/user" checkbox="true" style='padding: 0px;'></ul>
				</div>
				<button type="button" onclick="exec_role();">保存</button>
			</div>
			<div region="center" split="true" style="width:200px;" title="用户组信息">
				<div id="group-div" style="height:550px; border: #ccc solid 1px; overflow: auto;">
					<ul id="group-ul" class="easyui-tree" url="system/Group/getRoleTree" checkbox="true" style='padding: 0px;'></ul>
				</div>
				<button type="button" onclick="exec_group();">保存</button>
			</div>
			<div region="east" split="true" style="width:150px;" title="村站信息" >
				<div id="xingzqh-div" style="height:550px; border: #ccc solid 1px; overflow: auto;">
					<ul id="xingzqh-ul" class="easyui-tree" url="system/BmbXingzqh/xingzqh" checkbox="true" style='padding: 0px;'></ul>
				</div>
				<button type="button" onclick="exec_xingzqh();">保存</button>
			</div>
		</div>
	</div>

	<div id="userinfo-div" class="easyui-window" modal="true" closed="true" resizable="false" minimizable="false" maximizable="false" collapsible="false" iconcls="icon-add" style="width: 350px; height: 300px; padding: 5px;" title="添加菜单">
		<form id="userinfo-form">
			<input type="hidden" name="userInfo.id" value="" />
			<table width="100%" class="table">
				<tr>
					<td width="40%">用户帐号:</td>
					<td width="60%"><input name="userInfo.username" type="text" style="width:140px; height:20px;" /></td>
				</tr>
				<tr>
					<td>用户密码:</td>
					<td>
						<input id="userinfo-password-hide" type="password" onchange="this.name='userInfo.password';$('#userinfo-password-show').val(this.value);" style="width:100px; height:20px;" />
						<input id="userinfo-password-show" type="text" onchange="$('#userinfo-password-hide').attr('name', 'userInfo.password');$('#userinfo-password-hide').val(this.value);" style="width:100px; height:20px; display: none;" />
						<button type="button" onclick="random_pwd();">随机</button>
					</td>
				</tr>
				<tr>
					<td>用户姓名:</td>
					<td><input name="userInfo.name" type="text" style="width:140px; height:20px;" /></td>
				</tr>
				<tr>
					<td>所属/管理医院:</td>
					<td>
						<select class="easyui-combotree" id="" name="hospitals" url="system/Hospital/getHospitalTree" multiple="true" cascadeCheck="false" style="width:200px;">
						</select>
					</td>
				</tr>
				<tr>
					<td>性别:</td>
					<td><select name="userInfo.sex" style="width:140px; height:20px;"><option value="1">男</option><option value="2">女</option></select></td>
				</tr>
				<tr>
					<td>账户状态:</td>
					<td><select name="userInfo.state" style="width:140px; height:20px;"><option value="1">启用</option><option value="0">禁用</option></select></td>
				</tr>
				<tr>
					<td colspan="2" align="left">明文密码:<input type="checkbox" onclick="if (this.checked) { $('#userinfo-password-hide').hide(); $('#userinfo-password-show').show(); } else { $('#userinfo-password-hide').show(); $('#userinfo-password-show').hide(); }" /></td>
				</tr>
				<tr>
					<td colspan="2">
						<button id="userinfo-button" type="button">提交</button>
						&nbsp;&nbsp;&nbsp;&nbsp;
						<button type="button" onclick="$('#userinfo-form')[0].reset();$('#userinfo-div').window('close');">取消</button>
					</td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>
